package com.ydjk.controller;

import com.ydjk.common.annotation.Log;
import com.ydjk.common.core.controller.BaseController;
import com.ydjk.common.core.domain.AjaxResult;
import com.ydjk.common.core.page.TableDataInfo;
import com.ydjk.common.enums.BusinessType;
import com.ydjk.common.utils.pageData.PageData;
import com.ydjk.common.utils.poi.ExcelUtil;
import com.ydjk.domain.JkHospitalArea;
import com.ydjk.domain.JkHospitalizationInfo;
import com.ydjk.domain.JkUser;
import com.ydjk.service.IJkHospitalizationService;
import com.ydjk.service.IJkUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 用户信息Controller
 *
 * @author ydjk
 * @date 2023-08-30
 */
@RestController
@RequestMapping("/user/hospitalization")
public class JkHospitalizationController extends BaseController
{
    @Autowired
    private IJkHospitalizationService iJkHospitalizationService;

    /**
     * 查询用户信息列表
     */
    @PreAuthorize("@ss.hasPermi('user:hospitalization:list')")
    @GetMapping("/list")
    public TableDataInfo list()
    {
        PageData pageData = getPageData();
        startPage();
        List<PageData> list = iJkHospitalizationService.selectHospitalization(pageData);
        return getDataTable(list);
    }


 /*   *//**
     * 修改用户信息
     *//*
    @PreAuthorize("@ss.hasPermi('user:hospitalization:edit')")
    @Log(title = "用户信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody JkHospitalizationInfo jkHospitalizationInfo)
    {

        return toAjax(iJkHospitalizationService.updateHospitalization(pageData));
    }*/
    /**
     * 修改用户住院信息
     */
    @PreAuthorize("@ss.hasPermi('system:hospitalization:edit')")
    @Log(title = "用户住院信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody JkHospitalizationInfo jkHospitalizationInfo)
    {
        return toAjax(iJkHospitalizationService.updateJkHospitalizationInfo(jkHospitalizationInfo));
    }



}
